program Project2;

{$APPTYPE CONSOLE}

uses
  SysUtils;

var
i, N0, N: integer;
x, y, a : double;
p1 : real;
fin : textFile;
steps:integer;
begin

  AssignFile (fin, 'input.txt');

  rewrite (fin);

  randomize;
  steps:=500000000;
  for i := 1 to steps do
  begin
    x := 2*random;
    y := 2*random;
    if ((x-1)*(x-1) + (y-1)*(y-1) <= 1) then
    begin
      N0 := N0 + 1;
    end;
    p1 := N0*4/i;
    if (i mod 10000 = 0) then
    begin
      writeln(fin, i,' ', p1);
      writeln(i/steps*100.0);
    end;
  end;
  closeFile (fin);
end.

